<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>天禾人才</title>
	<meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="minimal-ui=yes,width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta name="msapplication-tap-highlight" content="no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">

	<link rel="stylesheet" type="text/css" href="css/public.css">
	<link rel="stylesheet" type="text/css" href="css/password.css">
</head>
<body>
	<div class="container">
		<div class="password">
			<div class="input">
				<label>真实姓名</label>
				<input type="text" id="realname">
			</div>
			<div class="input">
				<label>身份证号</label>
				<input type="text" id="idNo">
			</div>
			<div class="btn">
				<a class="per-btn" href="javascript:dealpwd();">提交</a>
			</div>
		</div>
	</div>	
</body>
<script type="text/javascript" src="js/jquery.min.js" ></script>
<script type="text/javascript" src="js/base.js"></script>
<script type="text/javascript">
checkWXLogin();
var userInfo = localStorage.getItem("user_info");
var user_info =  JSON.parse(userInfo);
var uid = user_info.id;

function dealpwd() {
	var realname = $("#realname").val();
	var idNo = $("#idNo").val();
	if(realname == '') {
		alert("真实姓名不能为空");
		return;
	}
	if(idNo == '') {
		alert("身份证号不能为空");
		return;
	}
	$.ajax({
		type: "POST",
		url: "/user/realname/auth",
		data:{
			"realname" : realname,
			"idNo" : idNo,
			"id" : uid
		},
		dataType:"json",
		async:false,
		success: function(data){
			if(data.code == 0){
				alert("认证成功");
				var target = window.location.href.split("#")[1];
				if(target == "my") {
					window.location.href="my.html";
				}else {
					window.location.href="dealpwd_set.html";
				}
			}else{
				alert(data.msg);
				return false;
			}
		}
	});
	
}
</script>
</html>